package ace.module.stock.core.impl.api.impl;

import ace.cmp.core.model.R;
import ace.module.common.api.annotation.ApiLocalPriority;
import ace.module.common.api.model.input.TenantAndAppTypeInput;
import ace.module.common.core.impl.api.impl.SdkApiImpl;
import ace.module.stock.api.WmsSalesQuantityApi;
import ace.module.stock.api.model.dto.WmsSalesQuantityDto;
import ace.module.stock.api.model.input.WmsBizInitInput;
import ace.module.stock.api.model.input.WmsBizParentIdInput;
import ace.module.stock.api.model.input.WmsBizUniqueIdInput;
import ace.module.stock.core.impl.dao.entity.WmsSalesQuantity;
import ace.module.stock.core.impl.manager.WmsSalesQuantityManager;
import ace.module.stock.core.impl.service.WmsSalesQuantityService;
import java.util.List;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.NotImplementedException;
import org.springframework.stereotype.Component;


/**
 * 销售数量 api implements.
 *
 * @author Caspar
 *
 */
@ApiLocalPriority
@AllArgsConstructor
@Component
public class WmsSalesQuantityApiImpl
    extends SdkApiImpl<WmsSalesQuantity, Long, WmsSalesQuantityDto, WmsSalesQuantityManager>
    implements WmsSalesQuantityApi {

  private final WmsSalesQuantityService wmsSalesQuantityService;

  @Override
  public R<Void> initOrNone(TenantAndAppTypeInput<List<WmsBizInitInput>> input) {
    throw new NotImplementedException();
    //wmsSalesQuantityService.initOrNone(input);
  }

  @Override
  public R<List<WmsSalesQuantityDto>> getByBizUniqueIdIn(TenantAndAppTypeInput<List<WmsBizUniqueIdInput>> bizUniqueIds) {
    List<WmsSalesQuantityDto> result = this.wmsSalesQuantityService.getDtoByBizUniqueIdIn(bizUniqueIds);
    return R.ok(result);
  }

  @Override
  public R<List<WmsSalesQuantityDto>> getByBizParentIdIn(TenantAndAppTypeInput<WmsBizParentIdInput> bizParentId) {
    List<WmsSalesQuantityDto> result = this.wmsSalesQuantityService.getDtoByBizParentIdIn(bizParentId);
    return R.ok(result);
  }
}
